#ifndef __SERIAL_TX_THREAD_H__
#define __SERIAL_TX_THREAD_H__
#if 0
#include <QThread>
#include <QByteArrayList>
#include <QSerialPort>
#include <QDebug>
class SerialTxThread : public QObject
{
    Q_OBJECT
    
    // void run() override;
    QByteArrayList*     txque;
    QSerialPort*        m_serial_inc;

public slots:
    void Tx(const QByteArray& msg) {
        qDebug() << "txthread";

        txque->push_back(msg);
        for (auto iter = txque->begin(); 
            iter != txque->end(); iter++)
        {
            // serial->write((*iter));
            qDebug() << "serial->write";
            m_serial_inc->write("123456");
        }
        txque->clear();
    }

public:
    SerialTxThread(void)
    {
        txque = new QByteArrayList;
        m_serial_inc = new QSerialPort;
    }
    ~SerialTxThread() {
        delete txque;
    }
    bool open() 
    {
        m_serial_inc->open(QIODevice::ReadWrite);
    }
    bool close() 
    {
        m_serial_inc->close();
    }
    bool isOpen()
    {
        return m_serial_inc->isOpen();
    }
    QSerialPort* Getinc()
    {
        return m_serial_inc;
    }
    bool AddNewTxMassage(QByteArray msg);
};

#endif 
#endif /* __SERIAL_TX_THREAD_H__ */
